//
//  WBWebViewController.swift
//  simpleWeibo
//
//  Created by sunmumu on 2019/4/29.
//  Copyright © 2019 孙林. All rights reserved.
//

import UIKit

class WBWebViewController: WBBaseController {

    fileprivate lazy var webView = UIWebView(frame: UIScreen.main.bounds)
    var urlString: String? {
        didSet {
            guard let urlString = urlString,
                    let url = URL.init(string: urlString)
                else {
                return
            }
            webView.loadRequest(URLRequest(url: url))
        }
    }
    
}

extension WBWebViewController {
    
    override func setupTableView() {
        navItem.title = "网页"
        view.insertSubview(webView, belowSubview: navigationBar)
        webView.backgroundColor = UIColor.white
        webView.scrollView.contentInset.top = navigationBar.bounds.height
        
    }

}
